﻿using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using System.Data;
using BEGDC.Utility.NHibernate;
using Castle.Services.Transaction;
using System.Collections;
using System.Xml;
using Castle.Facilities.NHibernateIntegration;

namespace BEGDC.PreContract.BLL
{
	public partial class TempContractList: ITempContractList
	{
        [Transaction(TransactionMode.Requires)]
        public string SaveContractListByUpload(System.Data.DataTable dtUpload)
        {
            string guid = Guid.NewGuid().ToString("D").ToUpper();

            foreach (System.Data.DataRow dr in dtUpload.Rows)
            {
                if (dr[0].ToString() == string.Empty)
                    continue;

                BEGDC.PreContract.DAL.TempContractList contract = new BEGDC.PreContract.DAL.TempContractList();

                contract.GUID = guid;
                contract.ContractNo = dr[0].ToString();
                contract.UpdateDate = System.DateTime.Now;

                contract.Create();
            }


            return guid;
        }
	}
}



